import request from '@/utils/request'

export function register(user) {
  return request({
    url: '/users/register',
    method: 'post',
    data: {
      username: user.username,
      gender: user.gender,
      phone: user.phone,
      password: user.password,
      isWriter: user.isWriter,
      name: user.name, // 对应 writer 表中的 name 字段
      penName: user.penName
    }
  })
}
